package com.bz.edu.info.manager.dao;

import com.bz.edu.info.manager.domin.Student;

import java.util.ArrayList;

public class StudentDao {
    private static ArrayList<Student> stuArrayList = new ArrayList<>();

    public ArrayList<Student> getStudentArrayList(){
        return stuArrayList;
    }
    public void addStudent(int stuNum,String name)
    {
        Student student = new Student();
        student.setName(name);
        student.setStuNum(stuNum);
        stuArrayList.add(student);
        System.out.println("添加成功");
    }
    public void deleteStudent(int index)
    {
        stuArrayList.remove(index);
        System.out.println("删除成功");
    }
    public void updateStudent(int index,String name)
    {
        Student student = stuArrayList.get(index);
        student.setName(name);
        System.out.println("修改成功");
    }
 }
